package com.aop.springbootaop.repository;

import com.aop.springbootaop.entity.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

public interface UserRepository extends MongoRepository<User, Long> {
    // 自定义查询方法
    @Query("{ 'name': ?0 }")
    User selectByName(String name);

    User findByName(int age);
}
